import QtQuick 2.0
import "../../js/util.js" as Util
import "../../js/UI.js" as UI

BaseDialog {
    id: m_dialog
    property var dataList
    property var phone
    signal chooseClick(var str, var data)

    Column {
        anchors.centerIn: parent
        Repeater {
            model: dataList
            delegate: Rectangle {
                width: m_dialog.width - (UI.LeftScale + UI.RightScale) * 2 * m_lineValue
                height: m_lineValue
                color: m_mouse.pressed ? "#aaaaaa" : "#ffffff"

                AText {
                    id: m_text
                    anchors.verticalCenter: parent.verticalCenter
                    font.pointSize: 18
                    text: "  %1".arg(dataList[index])
                }

                SplitLine {
                    visible: index>0
                    width: parent.width
                    anchors {
                        top: parent.top
                    }
                }

                MouseArea {
                    id: m_mouse
                    anchors.fill: parent
                    onClicked: {
                        chooseClick(dataList[index], phone)
                        destroyDialogObject()
                    }
                }
            }
        }
    }
}

